<?php
/**
 * Created by PhpStorm.
 * User: Season
 * Date: 2018/10/9
 * Time: 17:33
 */

namespace app\api\validate;


class IDMustBePostiveInt extends BaseValidate
{
    protected $rule=[
        'id'=>'require|isPositiveInteger'
    ];
    protected $message = [
        'id' => 'id必须是正整数'
    ];

    protected function isPositiveInteger($value,$rule=[],$date=[],$field=''){
        if(is_numeric ($value) && is_int ($value+0) && ($value+0)>0)return true;
        else return $field.'必须是正整数';
    }
}